package com.celesea.workflow.core.entity;

import com.celesea.framework.entity.BusEntity;
import com.celesea.framework.util.Version;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * 流程授权
 * @author JackYuan
 * @create 2017-11-05 16:28
 */
@Version
@Table(name = "wf_permission")
public class WorkflowPermission extends BusEntity {

    public enum WorkflowPermissionType {
        SUBMIT(0, "提交权限"),
        STATISTICS(1, "统计权限"),
        DEFINE(2, "维护权限");
        private int code;
        private String name;

        WorkflowPermissionType(int code, String name) {
            this.code = code;
            this.name = name;
        }

        public int getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }

    @Column(name = "`workflow_type`", columnDefinition = "流程类型")
    protected Integer workflowType;

    @Column(name = "`user_id`", columnDefinition = "用户")
    protected String userId;

    @Column(name = "`role_id`", columnDefinition = "角色")
    protected String roleId;

    @Column(name = "`dept_id`", columnDefinition = "部门")
    protected String deptId;

    @Column(name = "`group_id`", columnDefinition = "群组")
    protected String groupId;

    @Column(name = "`name`", columnDefinition = "授权对象名称")
    private String name;

    @Column(name = "`type`", columnDefinition = "权限类型")
    protected Integer type;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getWorkflowType() {
        return workflowType;
    }

    public void setWorkflowType(Integer workflowType) {
        this.workflowType = workflowType;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
